//
//  HeaderView.m
//  Game2048
//
//  Created by tarena on 16/3/25.
//  Copyright © 2016年 tarena. All rights reserved.
//

#import "HeaderView.h"

@implementation HeaderView

-( UIButton *)leftBtn{
    if (!_leftBtn) {
        _leftBtn = [[UIButton alloc]initWithFrame:CGRectMake(10, 10, 40, 40)];
        [_leftBtn setImage:[UIImage imageNamed:@"left_menu_btn"] forState:UIControlStateNormal];
        _leftBtn.clipsToBounds = YES;
        _leftBtn.layer.cornerRadius = 20;
        
    }
    return _leftBtn;
}

-( UIButton *)refreshBtn{
    if (!_refreshBtn) {
        _refreshBtn = [[UIButton alloc]initWithFrame:CGRectMake(self.bounds.size.width - 90, 10, 40, 40)];
        [_refreshBtn setImage:[UIImage imageNamed:@"refresh_btn"] forState:UIControlStateNormal];
    }
    return _refreshBtn;
}

-( UIButton *)rightBtn{
    if (!_rightBtn) {
        _rightBtn = [[UIButton alloc]initWithFrame:CGRectMake(self.bounds.size.width - 45, 10, 40, 40)];
        [_rightBtn setImage:[UIImage imageNamed:@"right_menu_btn"] forState:UIControlStateNormal];
    }
    return _rightBtn;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.frame = frame;
        [self addSubview:self.leftBtn];
        [self addSubview:self.refreshBtn];
        [self addSubview:self.rightBtn];
    }
    return self;
}


@end
